package com.diankangwo.dao.impl;

import com.diankangwo.dao.PayResultDAO;
import com.diankangwo.domain.PayResult;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

/***
 * @author songrongye PayResultDAO的实现类
 */
@Repository
public class PayResultDAOImpl extends BaseDaoImpl<PayResult> implements PayResultDAO {

	/***
	 * 根据缴费编号查询缴费结果 return PayResult
	 */
	@Override
	public PayResult queryByBillNo(String billNo) {
		if (billNo != null) {

			PayResult payResult = this.findUniqueByProperty("billNo", billNo);
			if (payResult != null) {
				return payResult;
			} else
				return null;
		} else
			return null;
	}

	public List<PayResult> queryByTime(Date date) {
		if (date != null) {

			List<PayResult> payResults = this.findByProperty("payTime", date);

			return payResults;
		}

		return null;

	}

}
